<?php
// 本类由系统自动生成，仅供测试用途
class CapitalSortMemberAction extends BaseLoginAction {
   function __construct() {
       parent::__construct();
       
   }
    public function index(){
        $this->redirect("lists");
    }
    
    public function lists(){
        $member=D("CapitalSortMember");
        $where=Array(
            "mid"=>  $this->uid
        );
        $page=  page(10, $member, $where);
        $this->assign("page",$page);
        $list=$member->where($where)->select();
        $this->assign("list",$list);
        $this->display();
    }
    public function add(){
        $this->display();
    }
    
    public function doadd(){
        $member=D("CapitalSortMember");
        if(isset($_POST['name'])&&$_POST['name']!=''){
            $data=Array(
                "name"=>$_POST['name'],
                "mid"=>$this->uid
            );
            $insert=$member->data($data)->add();
            if($insert){
                $this->assign("jumpUrl",U("lists"));
                $this->success("添加成功");
            }else{
                $this->error("添加失败");
            }
        }else{
            $this->error("数据错误");
        }
    }
    
    public function edit(){
        if(isset($_GET['id'])&&  intval($_GET['id'])>0){
            $id=  intval($_GET['id']);
        }else{
            $this->error("数据错误");
        }
    }
    
}